import os

from distutils.core import setup

def to_include(search='.'):
    """
    to_include
    ==========
    
    to_include(search='.') -> tuple(packages, files)
    Generate a list of directory ``search`` packages and data files to include in a distutils setup.
    
    """
    packages, data = [], []
    for path, dirs, files in os.walk(search):
        for directory in dirs:
            if directory.startswith('.'):
                del dirs[dirs.index(directory)]

        if '__init__.py' in files:
            packages.append(path.replace('/', '.'))
        else:
            data.append((path, [os.path.join(path, item) for item in files]))

    return packages, data

packages, data_files = to_include('wow')
setup(
    name='wow-python',
    version='0.1',
    url='http://127.0.0.1/',
    description='A Python library designed to interface developers with the World of Warcraft Armory.',
    packages=packages,
    data_files=data_files
)
